<?php

namespace app\models;

use Yii;
use yii\base\Model;

/**
 * ContactForm is the model behind the contact form.
 */
class ChangepwForm extends Model
{
    public $name;
    public $new_pw;

    /**
     * @return array the validation rules.
     */
    public function rules()
    {
        return [
            [['name', 'new_pw'], 'required'],
            ['new_pw','string','min'=>1,'max'=>16],
            ['name','\app\validators\ChangepwrightValidator'],
        ];
    }

    /**
     * @return array customized attribute labels
     */
     public function attributeLabels()
     {
         return [
             'name' => '会员名',
             'new_pw' => '新密码'
         ];
     }

}
